﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMSLibrary.TagsCreate.CustomFunction;
using CMSLibrary.TagsCreate.CustomFunction.Common;
using CMSLibrary.TagsCreate.CustomFunction.Inside;

namespace CMSLibrary.TagsCreate
{
    /// <summary>
    /// 模板替换引擎_返回匹配类
    /// </summary>
    public partial class TemplateRepeater
    {
        /// <summary>
        /// 返回指定的自定义方法
        /// </summary>    
        private PFunctionBase GetCustomFunction(string FunName)
        {
            PFunctionBase result = null;
            switch (FunName.ToUpper())
            {
                //普通
                case "SUBSTRING":   //截取字符串
                    result = new Custom_Substring();
                    break;
                case "DATETIME":    //格式化日期
                    result = new Custom_DateTime();
                    break;
                case "WEEK"://星期
                    result = new Custom_Week();
                    break;
                case "DAYOFYEAR"://一年中的第几天
                    result = new Custom_DayOfYear();
                    break;
                case "INSTALLDIR"://安装目录
                    result = new Custom_InstallDir();
                    break;
                case "DATEDIFF"://日期间隔
                    result = new Custom_DateDiff();
                    break;
                case "IMAGESDNS"://图片域名
                    result = new Custom_ImagesDNS();
                    break;
                case "HOSTDNS"://主机域名
                    result = new Custom_HostDNS();
                    break;
                case "SPLITCHAR": //追加的分隔符
                    result = new Custom_SplitChar();
                    break;
                case "SWITCH": //条件匹配
                    result = new Custom_Switch();
                    break;

                //内部                
                case "TAG"://标签
                    result = new Custom_SpecialTag();
                    break;
                case "STATISTICS": //流量统计
                    result = new Custom_Statistics();
                    break;
                case "LOCATION": //所在位置
                    result = new Custom_Location();
                    break;
                case "AD": //广告发布
                    result = new Custom_AD();
                    break;
            }
            return result;
        }
    }
}